package com.fuluwa.domain.usercenter.model.competence;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

import com.fuluwa.domain.shared.AbstractIdDomainObject;
import com.fuluwa.domain.usercenter.model.UserProfile.UserType;

@MappedSuperclass
public abstract class AbstractDefine extends AbstractIdDomainObject {
	protected String name;
	@Column(name = "f_value", columnDefinition = "decimal(13,2)")
	protected float value;

	public AbstractDefine() {
	}

	public AbstractDefine(String name, float value) {
		this.name = name;
		this.value = value;
	}

	public float compute() {
		return value;
	}

	public static void main(String[] args) {
		MaterialDefine materialDefine = new MaterialDefine("Generic Certification", 0.4f, UserType.STUDENT);

		MaterialSubDefine materialSubDefine = new MaterialSubDefine("Foreign Language", 0.25f, materialDefine);

		MaterialLevelType levelType = new MaterialLevelType(materialSubDefine, "CET");

		MaterialLevelDefine levelDefine = new MaterialLevelDefine("CET-4", 2, levelType);

		System.out.println(levelDefine.compute());
	}

	public String getName() {
		return name;
	}

	public float getValue() {
		return value;
	}

}
